{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "from PIL import Image\n",
    "image = np.load('pneumoniamnist.npz')\n",
    "x_train = image['train_images']\n",
    "x_label = image['train_labels']\n",
    "\n",
    "im1 = Image.fromarray(x_train[28])\n",
    "im0 = Image.fromarray(x_train[-20])\n",
    "\n",
    "im1.save('image_label_1.png')\n",
    "im0.save('image_label_0.png')"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "modellib",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.15"
  },
  "orig_nbformat": 4,
  "vscode": {
   "interpreter": {
    "hash": "dfa0523b1e359b8fd3ea126fa0459d0c86d49956d91b464930b80cba21582eac"
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
